<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: drogon::HttpController&lt; T, AutoCreation &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacedrogon.html">drogon</a></li><li class="navelem"><a class="el" href="classdrogon_1_1HttpController.html">HttpController</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-static-attribs">静态 Public 属性</a> &#124;
<a href="#pro-static-methods">静态 Protected 成员函数</a> &#124;
<a href="classdrogon_1_1HttpController-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">drogon::HttpController&lt; T, AutoCreation &gt; 模板类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>The reflection base class template for HTTP controllers  
 <a href="classdrogon_1_1HttpController.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="HttpController_8h_source.html">HttpController.h</a>&gt;</code></p>
<div class="dynheader">
类 drogon::HttpController&lt; T, AutoCreation &gt; 继承关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classdrogon_1_1HttpController__inherit__graph.png" border="0" usemap="#adrogon_1_1HttpController_3_01T_00_01AutoCreation_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="adrogon_1_1HttpController_3_01T_00_01AutoCreation_01_4_inherit__map" id="adrogon_1_1HttpController_3_01T_00_01AutoCreation_01_4_inherit__map">
<area shape="rect" title="The reflection base class template for HTTP controllers" alt="" coords="111,152,278,192"/>
<area shape="rect" href="classdrogon_1_1DrObject.html" title=" " alt="" coords="5,79,176,104"/>
<area shape="poly" title=" " alt="" coords="118,110,171,150,168,154,115,114"/>
<area shape="rect" href="classdrogon_1_1DrObjectBase.html" title="The base class for all drogon reflection classes." alt="" coords="9,5,173,31"/>
<area shape="poly" title=" " alt="" coords="93,44,93,79,88,79,88,44"/>
<area shape="rect" href="classdrogon_1_1HttpControllerBase.html" title="The base class for HTTP controllers." alt="" coords="201,79,399,104"/>
<area shape="poly" title=" " alt="" coords="275,114,222,154,218,150,272,110"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">图例</a>]</span></center></div>
<div class="dynheader">
drogon::HttpController&lt; T, AutoCreation &gt; 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="classdrogon_1_1HttpController__coll__graph.png" border="0" usemap="#adrogon_1_1HttpController_3_01T_00_01AutoCreation_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="adrogon_1_1HttpController_3_01T_00_01AutoCreation_01_4_coll__map" id="adrogon_1_1HttpController_3_01T_00_01AutoCreation_01_4_coll__map">
<area shape="rect" title="The reflection base class template for HTTP controllers" alt="" coords="111,152,278,192"/>
<area shape="rect" href="classdrogon_1_1DrObject.html" title=" " alt="" coords="5,79,176,104"/>
<area shape="poly" title=" " alt="" coords="118,110,171,150,168,154,115,114"/>
<area shape="rect" href="classdrogon_1_1DrObjectBase.html" title="The base class for all drogon reflection classes." alt="" coords="9,5,173,31"/>
<area shape="poly" title=" " alt="" coords="93,44,93,79,88,79,88,44"/>
<area shape="rect" href="classdrogon_1_1HttpControllerBase.html" title="The base class for HTTP controllers." alt="" coords="201,79,399,104"/>
<area shape="poly" title=" " alt="" coords="275,114,222,154,218,150,272,110"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">图例</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-attribs" name="pub-static-attribs"></a>
静态 Public 属性</h2></td></tr>
<tr class="memitem:a85db073549a1386e2b4fefc4739400dd" id="r_a85db073549a1386e2b4fefc4739400dd"><td class="memItemLeft" align="right" valign="top">static constexpr bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdrogon_1_1HttpController.html#a85db073549a1386e2b4fefc4739400dd">isAutoCreation</a> = AutoCreation</td></tr>
<tr class="separator:a85db073549a1386e2b4fefc4739400dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-static-methods" name="pro-static-methods"></a>
静态 Protected 成员函数</h2></td></tr>
<tr class="memitem:a2bcceb5ceef48c86f8ec2e1760377682" id="r_a2bcceb5ceef48c86f8ec2e1760377682"><td class="memTemplParams" colspan="2">template&lt;typename FUNCTION &gt; </td></tr>
<tr class="memitem:a2bcceb5ceef48c86f8ec2e1760377682"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdrogon_1_1HttpController.html#a2bcceb5ceef48c86f8ec2e1760377682">registerMethod</a> (FUNCTION &amp;&amp;function, const std::string &amp;pattern, const std::vector&lt; internal::HttpConstraint &gt; &amp;constraints={}, bool classNameInPath=true, const std::string &amp;handlerName=&quot;&quot;)</td></tr>
<tr class="separator:a2bcceb5ceef48c86f8ec2e1760377682"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7b7dc66a02baa5fb8cd4f988e8879b2" id="r_ae7b7dc66a02baa5fb8cd4f988e8879b2"><td class="memTemplParams" colspan="2">template&lt;typename FUNCTION &gt; </td></tr>
<tr class="memitem:ae7b7dc66a02baa5fb8cd4f988e8879b2"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdrogon_1_1HttpController.html#ae7b7dc66a02baa5fb8cd4f988e8879b2">registerMethodViaRegex</a> (FUNCTION &amp;&amp;function, const std::string &amp;regExp, const std::vector&lt; internal::HttpConstraint &gt; &amp;constraints=std::vector&lt; internal::HttpConstraint &gt;{}, const std::string &amp;handlerName=&quot;&quot;)</td></tr>
<tr class="separator:ae7b7dc66a02baa5fb8cd4f988e8879b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pub_methods_classdrogon_1_1DrObject"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classdrogon_1_1DrObject')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classdrogon_1_1DrObject.html">drogon::DrObject&lt; T &gt;</a></td></tr>
<tr class="memitem:af9339c889b7564b0222b25f42d5a07f1 inherit pub_methods_classdrogon_1_1DrObject" id="r_af9339c889b7564b0222b25f42d5a07f1"><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdrogon_1_1DrObject.html#af9339c889b7564b0222b25f42d5a07f1">className</a> () const override</td></tr>
<tr class="memdesc:af9339c889b7564b0222b25f42d5a07f1 inherit pub_methods_classdrogon_1_1DrObject"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the class name  <br /></td></tr>
<tr class="separator:af9339c889b7564b0222b25f42d5a07f1 inherit pub_methods_classdrogon_1_1DrObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51a4b49229662565393999a573549d91 inherit pub_methods_classdrogon_1_1DrObject" id="r_a51a4b49229662565393999a573549d91"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdrogon_1_1DrObject.html#a51a4b49229662565393999a573549d91">isClass</a> (const std::string &amp;class_name) const override</td></tr>
<tr class="memdesc:a51a4b49229662565393999a573549d91 inherit pub_methods_classdrogon_1_1DrObject"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the class name is 'class_name'  <br /></td></tr>
<tr class="separator:a51a4b49229662565393999a573549d91 inherit pub_methods_classdrogon_1_1DrObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classdrogon_1_1DrObjectBase"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classdrogon_1_1DrObjectBase')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classdrogon_1_1DrObjectBase.html">drogon::DrObjectBase</a></td></tr>
<tr class="memitem:a3a57e74527aea2d71d9f471b39c70d1b inherit pub_methods_classdrogon_1_1DrObjectBase" id="r_a3a57e74527aea2d71d9f471b39c70d1b"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdrogon_1_1DrObjectBase.html#a3a57e74527aea2d71d9f471b39c70d1b">~DrObjectBase</a> ()</td></tr>
<tr class="separator:a3a57e74527aea2d71d9f471b39c70d1b inherit pub_methods_classdrogon_1_1DrObjectBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_static_methods_classdrogon_1_1DrObject"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classdrogon_1_1DrObject')"><img src="closed.png" alt="-"/>&#160;静态 Public 成员函数 继承自 <a class="el" href="classdrogon_1_1DrObject.html">drogon::DrObject&lt; T &gt;</a></td></tr>
<tr class="memitem:af230f756b629164dce22b02d218525c1 inherit pub_static_methods_classdrogon_1_1DrObject" id="r_af230f756b629164dce22b02d218525c1"><td class="memItemLeft" align="right" valign="top">static const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdrogon_1_1DrObject.html#af230f756b629164dce22b02d218525c1">classTypeName</a> ()</td></tr>
<tr class="separator:af230f756b629164dce22b02d218525c1 inherit pub_static_methods_classdrogon_1_1DrObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classdrogon_1_1DrObject"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classdrogon_1_1DrObject')"><img src="closed.png" alt="-"/>&#160;Protected 成员函数 继承自 <a class="el" href="classdrogon_1_1DrObject.html">drogon::DrObject&lt; T &gt;</a></td></tr>
<tr class="memitem:a40297265c7f2318938e4fb159b26aa7b inherit pro_methods_classdrogon_1_1DrObject" id="r_a40297265c7f2318938e4fb159b26aa7b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdrogon_1_1DrObject.html#a40297265c7f2318938e4fb159b26aa7b">DrObject</a> ()=default</td></tr>
<tr class="separator:a40297265c7f2318938e4fb159b26aa7b inherit pro_methods_classdrogon_1_1DrObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86f55fd2a033d31e1811e60a525c33ad inherit pro_methods_classdrogon_1_1DrObject" id="r_a86f55fd2a033d31e1811e60a525c33ad"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdrogon_1_1DrObject.html#a86f55fd2a033d31e1811e60a525c33ad">~DrObject</a> () override=default</td></tr>
<tr class="separator:a86f55fd2a033d31e1811e60a525c33ad inherit pro_methods_classdrogon_1_1DrObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename T, bool AutoCreation = true&gt;<br />
class drogon::HttpController&lt; T, AutoCreation &gt;</div><p>The reflection base class template for HTTP controllers </p>
<dl class="tparams"><dt>模板参数</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">T</td><td>the type of the implementation class </td></tr>
    <tr><td class="paramname">AutoCreation</td><td>The flag for automatically creating, user can set this flag to false for classes that have nondefault constructors. </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a2bcceb5ceef48c86f8ec2e1760377682" name="a2bcceb5ceef48c86f8ec2e1760377682"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2bcceb5ceef48c86f8ec2e1760377682">&#9670;&#160;</a></span>registerMethod()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , bool AutoCreation = true&gt; </div>
<div class="memtemplate">
template&lt;typename FUNCTION &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classdrogon_1_1HttpController.html">drogon::HttpController</a>&lt; T, AutoCreation &gt;::registerMethod </td>
          <td>(</td>
          <td class="paramtype">FUNCTION &amp;&amp;&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; internal::HttpConstraint &gt; &amp;&#160;</td>
          <td class="paramname"><em>constraints</em> = <code>{}</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>classNameInPath</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>handlerName</em> = <code>&quot;&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ae7b7dc66a02baa5fb8cd4f988e8879b2" name="ae7b7dc66a02baa5fb8cd4f988e8879b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7b7dc66a02baa5fb8cd4f988e8879b2">&#9670;&#160;</a></span>registerMethodViaRegex()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , bool AutoCreation = true&gt; </div>
<div class="memtemplate">
template&lt;typename FUNCTION &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classdrogon_1_1HttpController.html">drogon::HttpController</a>&lt; T, AutoCreation &gt;::registerMethodViaRegex </td>
          <td>(</td>
          <td class="paramtype">FUNCTION &amp;&amp;&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>regExp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; internal::HttpConstraint &gt; &amp;&#160;</td>
          <td class="paramname"><em>constraints</em> = <code>std::vector&lt;internal::HttpConstraint&gt;{}</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>handlerName</em> = <code>&quot;&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a85db073549a1386e2b4fefc4739400dd" name="a85db073549a1386e2b4fefc4739400dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85db073549a1386e2b4fefc4739400dd">&#9670;&#160;</a></span>isAutoCreation</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , bool AutoCreation = true&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr bool <a class="el" href="classdrogon_1_1HttpController.html">drogon::HttpController</a>&lt; T, AutoCreation &gt;::isAutoCreation = AutoCreation</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">constexpr</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li><a class="el" href="HttpController_8h_source.html">HttpController.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
